//
//  ViewController.m
//  OCAPPDemo
//
//  Created by Apple on 2021/3/24.
//

#import "ViewController.h"
#import "DWKVOViewController.h"
#import "DWKVOPerson.h"
#import "DWUIViewController.h"
#import "DWAnimationViewController.h"

@interface ViewController ()

@property (nonatomic, strong) DWKVOPerson *person;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.person = [DWKVOPerson new];
    
    //NSObject __autoreleasing *obj = [[NSObject alloc] init];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    NSLog(@"%s %@", __FUNCTION__, segue.destinationViewController);
    if ([segue.destinationViewController isKindOfClass:NSClassFromString(@"DWKVOViewController")]) {
        NSLog(@"KVO");
        DWKVOViewController *kvoVC = (DWKVOViewController *)segue.destinationViewController;
        [kvoVC setValue:self.person forKey:@"p"];
    }
}

- (void)prepareForInterfaceBuilder {
    NSLog(@"%s", __FUNCTION__);
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
//    [self.person setValue:@"aaa" forKey:@"fullName"];
    //self.person.fullName = @"a";
    
    float f1 = 3.9434567, f2;
    int i1, i2 = 3;
    
    i1 = f1;
    f2 = i2;
    
    NSLog(@"%d %f", i1, f2);
    
    /*
    [ViewController respondsToSelector:@selector(aa)];
    
    [ViewController instanceMethodForSelector:@selector(aa)];
    
    [self respondsToSelector:@selector(aa)];
    */
    //@"a1233456789rtyuifghjksdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd";
    
    
    [self sendAuthRequest];
}

- (void)testString {
    NSString *str = @"1";
    NSNumber *a = @1;
    NSLog(@"%@", (str == @"1") ? @"YES":@"NO");
    NSLog(@"%p %p %p", str, @"1", a);
    
}


-(void)sendAuthRequest {
    //构造SendAuthReq结构体
    
}

- (IBAction)clickZQButton:(id)sender {
    
}

- (IBAction)UIAction:(id)sender {
    DWUIViewController *vc = [[DWUIViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
    
}


- (IBAction)animation:(id)sender {
    
    DWAnimationViewController *av = [[DWAnimationViewController alloc] init];
    [self.navigationController pushViewController:av animated:YES];
    
}

@end














